<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%--
  Created by IntelliJ IDEA.
  User: GGDog
  Date: 2023/6/9
  Time: 21:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>DamList</title>
    <style type="text/css">
        @import "css/bootstrap-css/bootstrap.min.css";
        @import "css/login.css";
    </style>
    <script src="js/bootstrap-js/jquery.min.js"></script>
    <script src="js/bootstrap-js/bootstrap.min.js"></script>

</head>
<body>
<h2>欢迎您，${user.name}</h2>
<div id="Carousel" class="carousel slide" data-ride="carousel">
    <!--标识图标：底下的小横线-->
    <ol class="carousel-indicators">
        <li data-target="#Carousel" data-slide-to="0" class="active"></li>
        <li data-target="#Carousel" data-slide-to="1"></li>
        <li data-target="#Carousel" data-slide-to="2"></li>
    </ol>
    <!--幻灯片-->
    <div class="carousel-inner">
        <div class="carousel-item active">
            <img src="media/background.png" class="d-block w-100" alt="">
            <div class="carousel-caption">
                <h5>轮播图效果</h5>
                <p>参宿</p>
            </div>
        </div>
        <div class="carousel-item active">
            <img src="media/loginBackGround.png" class="d-block w-100" alt="">
            <div class="carousel-caption">
                <h5>轮播图效果</h5>
                <p>参宿</p>
            </div>
        </div>
        <div class="carousel-item active">
            <img src="media/background.png" class="d-block w-100" alt="">
            <div class="carousel-caption">
                <h5>轮播图效果</h5>
                <p>参宿</p>
            </div>
        </div>


    </div>
    <!--控制按钮-->
    <a class="carousel-control-prev" href="#Carousel" data-slide="prev">
        <span class="carousel-control-prev-icon"></span>
    </a>
    <a class="carousel-control-next" href="#Carousel" data-slide="next">
        <span class="carousel-control-next-icon"></span>
    </a>
</div>
<table border="1" class="table">
    <thead class="thead-dark">
    <tr>
        <th scope="col">id</th><th scope="col">name</th><th scope="col">river</th><th scope="col">capacity</th><th scope="col">completeDate</th><th scope="col">操作</th>
    </tr>
    </thead>

    <c:forEach var="dam" items="${damList}">
        <tbody>
        <tr>
            <td>
                <c:out value="${dam.id}" />
            </td>
            <td>
                <c:out value="${dam.name}" />
            </td>
            <td>
                <c:out value="${dam.river}" />
            </td>
            <td>
                <c:out value="${dam.capacity}" />
            </td>
            <td>
                <c:out value="${dam.completeDate}" />
            </td>
            <td>

                <a class="btn btn-warning" href="UpdateDamViewServlet?id=${dam.id}">修改</a>
                <a class="btn btn-danger" href="DeleteDamServlet?id=${dam.id}">删除</a>
            </td>
        </tr>
        </tbody>
    </c:forEach>
</table>
<a class="btn btn-primary " style="position:relative;left:50%;margin-left:-25%;width: 500px" href="AddDam.jsp">新增Dam</a>

<script>
    $('.carousel').carousel({
        interval: 2500
    })
</script>
</body>
</html>
